//
//  NSKeyedUnarchiver+YBAdd.m
//  YBCategories
//
//  Created by yiban on 16/6/14.
//  Copyright © 2016年 lcb. All rights reserved.
//
#import "NSKeyedUnarchiver+YBAdd.h"
#import "YBCategoriesMacro.h"

YBSYNTH_DUMMY_CLASS(NSKeyedUnarchiver_YBAdd)


@implementation NSKeyedUnarchiver (YBAdd)

+ (id)unarchiveObjectWithData:(NSData *)data exception:(__autoreleasing NSException **)exception {
    id object = nil;
    @try {
        object = [NSKeyedUnarchiver unarchiveObjectWithData:data];
    }
    @catch (NSException *e)
    {
        if (exception) *exception = e;
    }
    @finally
    {
    }
    return object;
}

+ (id)unarchiveObjectWithFile:(NSString *)path exception:(__autoreleasing NSException **)exception {
    id object = nil;
    
    @try {
        object = [NSKeyedUnarchiver unarchiveObjectWithFile:path];
    }
    @catch (NSException *e)
    {
        if (exception) *exception = e;
    }
    @finally
    {
    }
    return object;
}

@end
